LoginSubscriber
extends AbstractController
in package
implements
EventSubscriberInterface
Table of Contents
Interfaces
- EventSubscriberInterface
Properties
- $urlGenerator : UrlGeneratorInterface
Methods
- __construct() : void
- Class LoginSubscriber
- getSubscribedEvents() : array<string|int, mixed>
- Returns the subscribed events for the LoginSubscriber class.
- onLogin() : void
- Event listener method called when a user logs in.
Properties
$urlGenerator
private
UrlGeneratorInterface
$urlGenerator
Methods
__construct()
Class LoginSubscriber
public
__construct(UrlGeneratorInterface $urlGenerator) : void
This class is responsible for handling login events. It is used to display a flash message when a user logs in. It is also used to redirect the user to the homepage after login. We don't want phpstan to check the constructor of this class so we ignore it.
Parameters
- $urlGenerator : UrlGeneratorInterface
Tags
getSubscribedEvents()
Returns the subscribed events for the LoginSubscriber class.
public
static getSubscribedEvents() : array<string|int, mixed>
Return values
array<string|int, mixed> —The subscribed events.
onLogin()
Event listener method called when a user logs in.
public
onLogin(InteractiveLoginEvent $event) : void
Parameters
- $event : InteractiveLoginEvent
-
The event object.